package accesoADatos;
import java.sql.*;
import javax.swing.*;

public class Conectar {
	Connection conect = null;

	public Connection conexion() {
		try 
		{
			// Cargamos el Driver MySQL
			Class.forName("org.gjt.mm.mysql.Driver");
			conect = DriverManager.getConnection("jdbc:mysql://localhost/pos", "root", "");
			JOptionPane.showMessageDialog(null, "conectado");
			
		} 
		catch (Exception e)
		{
			JOptionPane.showMessageDialog(null, "Error de coneccion " + e);
		}
		return conect;
	}

	public static void main(String arg[]) {

		new Conectar().conexion();
	}
}
